Additional Notes
Zernike.metrics(ΔW::Wavefront)exists;Zernike.format_strings(Z::AbstractPolynomial)will return both theUnicodeandLaTeXstring representations directly;Zernike.print_strings(j_max::Int)will print the Unicode string representations of the polynomials up toj_max;The
zplotfunction can be invoked independently usingPolynomialandWavefrontfunction types, quantized wavefront errors, and Observables of each; the plot will update each time theObservablechanges (see the docstring for more info);If you resize the plot window, right clicking on the figure will resize / trim the plot automatically so that it fits within the window without extra space;
PolynomialandWavefronttypes can be indexed (zero-based) to return a specific coefficient; their full vector of coefficients can be conveniently accessed using single-argumentgetindex(e.g.z[],w[]);Callable types can be called with complex arguments as a convenient method to evaluate them in Cartesian coordinates;
The Zernike polynomials are currently only valid up to degree ~812 at which point the maximum coefficient approaches the maximum for double-precision floating-point numbers (~1e308);
- because 64-bit floats are used for an expanded range by default the coefficients are exactly accurate up to order ~47, limited by the 53-bit (~1e16) precision of the significand after which results are only approximate; if more accuracy is desired arbitrary precision or plain
Ints can be specified by passing the appropriate type (Int,BigInt,BigFloat) as the third argument toZernike.radial_coefficients;
- because 64-bit floats are used for an expanded range by default the coefficients are exactly accurate up to order ~47, limited by the 53-bit (~1e16) precision of the significand after which results are only approximate; if more accuracy is desired arbitrary precision or plain
If you're interested in precompiling the package into a system image in order to speed up load times please see the precompile directory (at the moment PrecompileTools or the like is not used);
If you're interested in only the full vector of Zernike expansion coefficients obtained through the least squares fit and want to avoid computing extra values and plotting the results you can call:
Zernike.wavefront_coefficients(ρ, θ, OPD, n_max)which will return the weights and the corresponding residual error.
Similarly you can do this for the radial polynomial coefficients and the NA transformed wavefront error expansion coefficients by importing the functions radial_coefficients and transform_coefficients, respectively.